package com.eight.clientcourse.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.eight.clientcourse.vo.CourseVo;
import com.eight.common.pojo.EduCourse;
import com.eight.common.pojo.EduVideo;
import com.eight.common.pojo.TbMember;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.HashMap;
import java.util.List;

/**
 * @program: qy8-education1
 * @description:
 * @author: 张亚祥
 * @create: 2023-06-02 16:23
 **/
public interface ClientCourseDao extends BaseMapper<EduCourse> {
    //由课程id获取到所有的视频

    @Select(value = "select v.*,c.* from edu_course c join edu_video v on c.id = v.course_id where c.id=#{id}")
    List<EduVideo> findVideo(String id);
    //获取手机号查到讲师所讲的课程
    @Select(value = "select v.*,c.*,t.* from edu_course c join edu_video v on c.id = v.course_id join edu_teacher t on c.teacher_id = t.id  where t.mobile=#{mobile} and c.id=#{id}")
    List<EduCourse> findTeacherByMobile(@Param("id") String id,@Param("mobile") String mobile);

    EduCourse queryAllCourseAndTeacherName(String id);
    TbMember queryMemberStatus(@Param("id") String id,@Param("mobile") String mobile);

    EduCourse coursePlay(String id);

    List<EduCourse> checkCourse();
}
